UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zAcDBn37CyGcNS3SP1tKOmn1+IXMd/BX+AIbFe01m3A='
WHERE
key_id = '81a18669645e3949228ff6dca873e14178636a086e092ecf3cc33acc5464d357'
AND (
token = 'zAcDBn37CyGcNS3SP1tKOmn1+IXMd/BX+AIbFe01m3A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)