UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8Uy4WwJhdwJvncFin4bYRwogr3KQgXFOAZzLEWhA2bs='
WHERE
key_id = '93d5cb8a22614e5cea7bbe7461132f51fc3ee9cf3a5b79fb5e68827e067f5785'
AND (
token = '8Uy4WwJhdwJvncFin4bYRwogr3KQgXFOAZzLEWhA2bs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)