UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'HsQhClN7qiURX3qqzsJI8dDS54hsq9iKihPukP3/ioY=' 
WHERE 
  key_id = '2cd53f615c5c18cf17761277e8bc0fc1e475de2e0efeffa2bc61f7aa00a5197c' 
  AND (
    token = 'HsQhClN7qiURX3qqzsJI8dDS54hsq9iKihPukP3/ioY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033