UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4KRBzXyHodsTLpnLE3iPQm63CoVhuzW2hys2kGFuPQg='
WHERE
key_id = 'e30b13c94eee2ed3bdf7dded9e63765d2f1c53b4f1092b93ae7c43f3076076a9'
AND (
token = '4KRBzXyHodsTLpnLE3iPQm63CoVhuzW2hys2kGFuPQg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)