UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8+bIRAiFEJtux/WkQCbmgou9MishCj4yQHV2Om2SZ08='
WHERE
key_id = '5a276a3e06fa25c92c60342373164f8c11d342bd8288fff54f2d5fd80dedea9f'
AND (
token = '8+bIRAiFEJtux/WkQCbmgou9MishCj4yQHV2Om2SZ08='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)