UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+mtwyB3EUbxEp2X5/YdkYX2r9bybiowIk0SvpDl/G5U='
WHERE
key_id = '5a4f76c6e74b8e778b64754022d6fb71fbe2068301dd7b457293ebb98ea84398'
AND (
token = '+mtwyB3EUbxEp2X5/YdkYX2r9bybiowIk0SvpDl/G5U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)