UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'f7+ubzjjfKnZ3Mc/WuSJayOSLNnAXmNHjH3iPUip0PM='
WHERE
key_id = '8b9bce7d53ba9a7f294f7fc00e8dc6e2af720861a55b17f5dcd9a5401482635f'
AND (
token = 'f7+ubzjjfKnZ3Mc/WuSJayOSLNnAXmNHjH3iPUip0PM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)