UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GgLJySV46nTu1XjIyt9zelPNsj30ZcQlNf6G1AHSbYw='
WHERE
key_id = 'cf29d452db6a1c2c6b965f9b5ad55ec531901ad81d619046514684cdcfad24ae'
AND (
token = 'GgLJySV46nTu1XjIyt9zelPNsj30ZcQlNf6G1AHSbYw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)